{% extends 'index.html' %}
{% block body %}
 {% for dao in pageData["objects"] %}
        <div >
        <table cellpadding="0" cellspacing="2" border="0">
            <tr>
                <td ><h3>
                {% if dao.id_cliente %}<strong>SCARICO</strong>{% endif %}
                {% if dao.id_fornitore %}<strong>CARICO</strong>{% endif %}
                </h3></td>
                <td ><h3>N.: <strong>{{dao.numero}}</strong></h3></td>
                <td ><h3>{{dao.operazione}}</h3></td>
                <td ><h3>Data{{utils.dateToString(dao.data_movimento)}}</h3> </td>
                <td ><h3>Cli/Forn.:
                {% if dao.id_cliente %}{{dao.ragione_sociale_cliente}}{% endif %}
                {% if dao.id_fornitore %}{{dao.ragione_sociale_fornitore}}{% endif %}</h3>
                </td>
                <td >
                {% if dao.id_fornitore %}<h3>Rif doc Forn: {{utils.daoTestDocu(dao).protocollo}}</h3>  {% endif %}
                </td>
                <td >
                {% if dao.id_cliente %}<h3>Veterinario  : {{utils.daoTestDocu(dao).ragione_sociale_agente}}</h3>  {% endif %}
                </td>
            </tr>
        </table>
        <table cellpadding="0" cellspacing="3" border="0">
            <tr>
                <th class="left">Articolo</th>
                <th class="number">Quantita'</th>
                <th class="number">LOTTO E SCADENZA</th>
            </tr>
                {% for riga in dao.righe %}
                <tr >

                <td>{{riga.descrizione[:30]}}</td>
                <td class="number">{{utils.number_format() % ( riga.quantita * riga.moltiplicatore )}}</td>

                <td class="number">{{utils.getLottoeScadenze(riga,dao).lotto}}{{utils.dateToString(utils.getLottoeScadenze(riga, dao).data_scadenza)}}</td></tr>
        {% endfor %}
        </table>
        <hr />
{% endfor %}

        </div>
{% endblock %}
